home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 2000 July / macformat-092.iso / MacFormat 92 CD / Shareware Plus / Utilities / FolderSynchronizer 1.8.9 / PlugIn / SR / 00001_sGeneral.ls next >
Encoding:
Text File  |  2000-03-23  |  11.6 KB  |  412 lines

  1. on startMovie
  2.   global gCurrLog, gShortReportList, gTotLog, gLogPathList, gRectReport, gAltezzaWind, gBaseWind, gShortFlag, gMaxLines, gSep
  3. end
  4.  
  5. on moveWindow
  6.   global gRectReport
  7.   set gRectReport to the rect of the frontWindow
  8. end
  9.  
  10. on resizeWindow
  11.   DrawControls()
  12. end
  13.  
  14. on zoomWindow
  15.   DrawControls()
  16. end
  17.  
  18. on closeWindow
  19.   global gCurrLogText
  20.   set gCurrLogText to VOID
  21.   tell the stage
  22.     do("ChiudiFreccia")
  23.     do("InitMenu")
  24.     do("SetMenuLista")
  25.   end tell
  26. end
  27.  
  28. on chiudiWindow
  29.   close(the frontWindow)
  30.   updateStage()
  31. end
  32.  
  33. on ScrollByVBar mySprite
  34.   set myBtnUp to the name of member the member of sprite mySprite
  35.   if char 4 to 5 of myBtnUp = "Of" then
  36.     exit
  37.   end if
  38.   set startCondizione to the locV of the clickLoc > (the bottom of sprite(19) - 2)
  39.   set RunCondizione to startCondizione
  40.   repeat while the stillDown and (startCondizione = RunCondizione)
  41.     if RunCondizione then
  42.       NextPageV()
  43.     else
  44.       PrevPageV()
  45.     end if
  46.     set RunCondizione to the locV of the clickLoc > (the bottom of sprite(19) - 2)
  47.   end repeat
  48. end
  49.  
  50. on FirstV
  51.   global gCurrLine, gTotLines, gMaxLines, gCurrLogText
  52.   if (gCurrLine > 1) and (gTotLines > 0) then
  53.     set gCurrLine to 1
  54.     set LastLine to gCurrLine + gMaxLines - 1
  55.     ImpostaVThumb()
  56.     updateStage()
  57.     put line gCurrLine to LastLine of gCurrLogText into field "fReport"
  58.   end if
  59. end
  60.  
  61. on LastV
  62.   global gCurrLine, gTotLines, gMaxLines, gCurrLogText
  63.   if ((gCurrLine + gMaxLines - 1) < gTotLines) and (gTotLines > 0) then
  64.     set gCurrLine to gTotLines - gMaxLines + 1
  65.     set LastLine to gCurrLine + gMaxLines - 1
  66.     ImpostaVThumb()
  67.     updateStage()
  68.     put line gCurrLine to LastLine of gCurrLogText into field "fReport"
  69.   end if
  70. end
  71.  
  72. on NextV
  73.   global gCurrLine, gTotLines, gMaxLines, gCurrLogText
  74.   if ((gCurrLine + gMaxLines - 1) < gTotLines) and (gTotLines > 0) then
  75.     set gCurrLine to gCurrLine + 1
  76.     set LastLine to gCurrLine + gMaxLines - 1
  77.     ImpostaVThumb()
  78.     updateStage()
  79.     put line gCurrLine to LastLine of gCurrLogText into field "fReport"
  80.   end if
  81. end
  82.  
  83. on PrevV
  84.   global gCurrLine, gTotLines, gMaxLines, gCurrLogText
  85.   if (gCurrLine > 1) and (gTotLines > 0) then
  86.     set gCurrLine to gCurrLine - 1
  87.     set LastLine to gCurrLine + gMaxLines - 1
  88.     ImpostaVThumb()
  89.     updateStage()
  90.     put line gCurrLine to LastLine of gCurrLogText into field "fReport"
  91.   end if
  92. end
  93.  
  94. on NextPageV
  95.   global gCurrLine, gTotLines, gMaxLines, gCurrLogText
  96.   if ((gCurrLine + gMaxLines - 1) < gTotLines) and (gTotLines > 0) then
  97.     set gCurrLine to gCurrLine + gMaxLines
  98.     if (gCurrLine + gMaxLines - 1) > gTotLines then
  99.       set gCurrLine to gTotLines - gMaxLines + 1
  100.       if gCurrLine < 1 then
  101.         set gCurrLine to 1
  102.       end if
  103.     end if
  104.     set LastLine to gCurrLine + gMaxLines - 1
  105.     ImpostaVThumb()
  106.     updateStage()
  107.     put line gCurrLine to LastLine of gCurrLogText into field "fReport"
  108.   end if
  109. end
  110.  
  111. on PrevPageV
  112.   global gCurrLine, gTotLines, gMaxLines, gCurrLogText
  113.   if (gCurrLine > 1) and (gTotLines > 0) then
  114.     set gCurrLine to gCurrLine - gMaxLines
  115.     if gCurrLine < 1 then
  116.       set gCurrLine to 1
  117.     end if
  118.     set LastLine to gCurrLine + gMaxLines - 1
  119.     ImpostaVThumb()
  120.     updateStage()
  121.     put line gCurrLine to LastLine of gCurrLogText into field "fReport"
  122.   end if
  123. end
  124.  
  125. on ImpostaVThumb
  126.   global gCurrLine, gTotLines, gMaxLines
  127.   if (gCurrLine = 1) or (gCurrLine = 0) then
  128.     set the locV of sprite 19 to the top of sprite 23
  129.   else
  130.     if (gCurrLine + gMaxLines - 1) = gTotLines then
  131.       set the locV of sprite 19 to the bottom of sprite 23
  132.     else
  133.       set dest to (float(the height of sprite 23) / float(gTotLines - gMaxLines) * float(gCurrLine - 1)) + the top of sprite 23
  134.       set the locV of sprite 19 to dest
  135.     end if
  136.   end if
  137. end
  138.  
  139. on ScrollByHBar mySprite
  140.   set myBtnUp to the name of member the member of sprite mySprite
  141.   if char 4 to 5 of myBtnUp = "Of" then
  142.     exit
  143.   end if
  144.   set startCondizione to the locH of the clickLoc > (the right of sprite(39) - 2)
  145.   set RunCondizione to startCondizione
  146.   repeat while the stillDown and (startCondizione = RunCondizione)
  147.     if RunCondizione then
  148.       NextH()
  149.     else
  150.       PrevH()
  151.     end if
  152.     set RunCondizione to the locH of the clickLoc > (the right of sprite(39) - 2)
  153.   end repeat
  154. end
  155.  
  156. on FirstH
  157.   global gCurrLog, gTotLog
  158.   if (gCurrLog > 1) and (gTotLog > 0) then
  159.     set gCurrLog to 1
  160.     ReadLogText()
  161.     ImpostaHThumb()
  162.     DrawVControls()
  163.   end if
  164. end
  165.  
  166. on LastH
  167.   global gCurrLog, gTotLog
  168.   if (gCurrLog < gTotLog) and (gTotLog > 0) then
  169.     set gCurrLog to gTotLog
  170.     ReadLogText()
  171.     ImpostaHThumb()
  172.     DrawVControls()
  173.   end if
  174. end
  175.  
  176. on NextH
  177.   global gCurrLog, gTotLog
  178.   if (gCurrLog < gTotLog) and (gTotLog > 0) then
  179.     set gCurrLog to gCurrLog + 1
  180.     ReadLogText()
  181.     ImpostaHThumb()
  182.     DrawVControls()
  183.   end if
  184. end
  185.  
  186. on PrevH
  187.   global gCurrLog, gTotLog
  188.   if (gCurrLog > 1) and (gTotLog > 0) then
  189.     set gCurrLog to gCurrLog - 1
  190.     ReadLogText()
  191.     ImpostaHThumb()
  192.     DrawVControls()
  193.   end if
  194. end
  195.  
  196. on ImpostaHThumb
  197.   global gCurrLog, gTotLog
  198.   if (gCurrLog = 1) or (gCurrLog = 0) then
  199.     set the locH of sprite 39 to the left of sprite 43
  200.   else
  201.     if gCurrLog = gTotLog then
  202.       set the locH of sprite 39 to the right of sprite 43
  203.     else
  204.       set dest to (float(the width of sprite 43) / float(gTotLog - 1) * float(gCurrLog - 1)) + the left of sprite 43
  205.       set the locH of sprite 39 to dest
  206.     end if
  207.   end if
  208. end
  209.  
  210. on DrawVControls
  211.   DrawControlVPrevLog(20)
  212.   DrawControlVBar(16)
  213.   DrawControlVThumb(19)
  214.   DrawControlVNextLog(21)
  215.   updateStage()
  216. end
  217.  
  218. on DrawControls
  219.   global gRectReport, gAltezzaWind, gBaseWind, gMaxLines
  220.   set gRectReport to the rect of the frontWindow
  221.   set gAltezzaWind to the bottom of gRectReport - the top of gRectReport
  222.   set gBaseWind to the right of gRectReport - the left of gRectReport
  223.   set the visible of sprite 15 to 0
  224.   set the visible of sprite 16 to 0
  225.   set the visible of sprite 19 to 0
  226.   set the visible of sprite 20 to 0
  227.   set the visible of sprite 21 to 0
  228.   set the visible of sprite 30 to 0
  229.   set the visible of sprite 31 to 0
  230.   set the visible of sprite 35 to 0
  231.   set the visible of sprite 36 to 0
  232.   set the visible of sprite 39 to 0
  233.   set the visible of sprite 40 to 0
  234.   set the visible of sprite 41 to 0
  235.   DrawControlVConstrainBar(23)
  236.   DrawControlHConstrainBar(43)
  237.   updateStage()
  238.   set gMaxLines to (gAltezzaWind - 5 - 15) / the textHeight of member "fReport"
  239.   DrawControlVPrevLog(20)
  240.   DrawControlVBar(16)
  241.   DrawControlVThumb(19)
  242.   DrawControlVNextLog(21)
  243.   DrawControlHPrevLog(40)
  244.   DrawControlHBar(36)
  245.   DrawControlHThumb(39)
  246.   DrawControlHNextLog(41)
  247.   DrawControlText(6)
  248.   updateStage()
  249.   set the visible of sprite 15 to 1
  250.   set the visible of sprite 16 to 1
  251.   set the visible of sprite 19 to 1
  252.   set the visible of sprite 20 to 1
  253.   set the visible of sprite 21 to 1
  254.   set the visible of sprite 30 to 1
  255.   set the visible of sprite 31 to 1
  256.   set the visible of sprite 35 to 1
  257.   set the visible of sprite 36 to 1
  258.   set the visible of sprite 39 to 1
  259.   set the visible of sprite 40 to 1
  260.   set the visible of sprite 41 to 1
  261. end
  262.  
  263. on DrawControlVConstrainBar mySprite
  264.   global gAltezzaWind
  265.   set the height of sprite mySprite to gAltezzaWind - 45 - 15
  266. end
  267.  
  268. on DrawControlVPrevLog mySprite
  269.   global gTotLines, gMaxLines, gBaseWind
  270.   set the locH of sprite mySprite to gBaseWind - 7
  271.   if gTotLines <= gMaxLines then
  272.     set the member of sprite mySprite to "BtnOfVPrev"
  273.   else
  274.     set the member of sprite mySprite to "BtnUpVPrev"
  275.   end if
  276. end
  277.  
  278. on DrawControlVBar mySprite
  279.   global gTotLines, gMaxLines, gBaseWind, gAltezzaWind
  280.   if gTotLines <= gMaxLines then
  281.     set the member of sprite mySprite to "BtnOfVBar"
  282.     set the member of sprite (mySprite - 1) to "BtnOfTopVBar"
  283.   else
  284.     set the member of sprite mySprite to "BtnUpVBar"
  285.     set the member of sprite (mySprite - 1) to "BtnUpTopVBar"
  286.   end if
  287.   set the locH of sprite (mySprite - 1) to gBaseWind - 7
  288.   set the locH of sprite mySprite to gBaseWind - 7
  289.   set the locV of sprite mySprite to the bottom of sprite (mySprite - 1)
  290.   set the height of sprite mySprite to gAltezzaWind - 32 - 15
  291. end
  292.  
  293. on DrawControlVThumb mySprite
  294.   global gTotLines, gMaxLines, gBaseWind
  295.   set the locH of sprite mySprite to gBaseWind - 7
  296.   if gTotLines <= gMaxLines then
  297.     set the member of sprite mySprite to "BtnOfVThumb"
  298.   else
  299.     set the member of sprite mySprite to "BtnUpVThumb"
  300.     ImpostaVThumb()
  301.   end if
  302. end
  303.  
  304. on DrawControlVNextLog mySprite
  305.   global gTotLines, gMaxLines, gAltezzaWind, gBaseWind
  306.   if gTotLines <= gMaxLines then
  307.     set the member of sprite mySprite to "BtnOfVNext"
  308.   else
  309.     set the member of sprite mySprite to "BtnUpVNext"
  310.   end if
  311.   set the locH of sprite mySprite to gBaseWind - 7
  312.   set the locV of sprite mySprite to 1 + gAltezzaWind - (the height of sprite mySprite / 2) - 15
  313. end
  314.  
  315. on DrawControlText mySprite
  316.   global gAltezzaWind, gBaseWind, gCurrLine, gTotLines, gMaxLines, gCurrLogText
  317.   set myMember to the member of sprite mySprite
  318.   set the rect of myMember to rect(0, 0, gBaseWind - 22, gAltezzaWind - 5 - 15)
  319.   set gMaxLines to the pageHeight of member "fReport" / the textHeight of member "fReport"
  320.   if (gCurrLine + gMaxLines - 1) > gTotLines then
  321.     set gCurrLine to gTotLines - gMaxLines + 1
  322.     if gCurrLine < 1 then
  323.       set gCurrLine to 1
  324.     end if
  325.   end if
  326.   set LastLine to gCurrLine + gMaxLines - 1
  327.   ImpostaVThumb()
  328.   put line gCurrLine to LastLine of gCurrLogText into field "fReport"
  329. end
  330.  
  331. on DrawControlHConstrainBar mySprite
  332.   global gBaseWind
  333.   set the width of sprite mySprite to gBaseWind - 45 - 15 - 15 - 15
  334.   updateStage()
  335. end
  336.  
  337. on DrawControlHPrevLog mySprite
  338.   global gTotLog, gAltezzaWind
  339.   set the locV of sprite mySprite to gAltezzaWind - 7
  340.   set the locV of sprite (mySprite - 10) to gAltezzaWind - 7
  341.   set the locV of sprite (mySprite - 9) to gAltezzaWind - 7
  342.   if gTotLog > 1 then
  343.     set the member of sprite mySprite to "BtnUpHPrev"
  344.   else
  345.     set the member of sprite mySprite to "BtnOfHPrev"
  346.   end if
  347. end
  348.  
  349. on DrawControlHBar mySprite
  350.   global gBaseWind, gAltezzaWind, gTotLog
  351.   if gTotLog > 1 then
  352.     set the member of sprite mySprite to "BtnUpHBar"
  353.     set the member of sprite (mySprite - 1) to "BtnUpTopHBar"
  354.   else
  355.     set the member of sprite mySprite to "BtnOfHBar"
  356.     set the member of sprite (mySprite - 1) to "BtnOfTopHBar"
  357.   end if
  358.   set the locV of sprite (mySprite - 1) to gAltezzaWind - 7
  359.   set the locV of sprite mySprite to gAltezzaWind - 7
  360.   set the locH of sprite mySprite to the right of sprite (mySprite - 1)
  361.   set the width of sprite mySprite to gBaseWind - 32 - 15 - 15 - 15
  362. end
  363.  
  364. on DrawControlHThumb mySprite
  365.   global gTotLog, gAltezzaWind
  366.   set the locV of sprite mySprite to gAltezzaWind - 7
  367.   if gTotLog > 1 then
  368.     set the member of sprite mySprite to "BtnUpHThumb"
  369.     ImpostaHThumb()
  370.   else
  371.     set the member of sprite mySprite to "BtnOfHThumb"
  372.   end if
  373. end
  374.  
  375. on DrawControlHNextLog mySprite
  376.   global gTotLog, gAltezzaWind, gBaseWind
  377.   if gTotLog > 1 then
  378.     set the member of sprite mySprite to "BtnUpHNext"
  379.   else
  380.     set the member of sprite mySprite to "BtnOfHNext"
  381.   end if
  382.   set the locV of sprite mySprite to gAltezzaWind - 7
  383.   set the locH of sprite mySprite to 1 + gBaseWind - (the width of sprite mySprite / 2) - 15
  384. end
  385.  
  386. on BtnUp Bottone
  387.   if Bottone <> EMPTY then
  388.     set BottoneUp to "BtnUp" & char 6 to the length of Bottone of Bottone
  389.     return BottoneUp
  390.   end if
  391. end
  392.  
  393. on BtnDw BottoneUp
  394.   set BottoneDw to "BtnDw" & char 6 to the length of BottoneUp of BottoneUp
  395.   return BottoneDw
  396. end
  397.  
  398. on BtnRL BottoneUp
  399.   set BottoneRL to "BtnRL" & char 6 to the length of BottoneUp of BottoneUp
  400.   return BottoneRL
  401. end
  402.  
  403. on BtnOf BottoneUp
  404.   set BottoneOf to "BtnOf" & char 6 to the length of BottoneUp of BottoneUp
  405.   return BottoneOf
  406. end
  407.  
  408. on BtnName BottoneUp
  409.   set Bottone to char 6 to the length of BottoneUp of BottoneUp
  410.   return Bottone
  411. end
  412.